<?php
namespace app\model;

use think\Model;

class User extends Model
{
    /**
     * 根据条件查询单条用户数据
     * @param array $where
     * @param string $field
     * @return array|Model
     */
    public function getOneInfoByWhere(array $where = [], $field = "*")
    {
        if(empty($where)) {
            return [];
        }
        return $this->field($field)->where($where)->findOrEmpty();
    }
}